diff options
Diffstat (limited to 'app/[lng]/evcp/(evcp)')
| -rw-r--r-- | app/[lng]/evcp/(evcp)/menu-access/page.tsx | 53 | ||||
| -rw-r--r-- | app/[lng]/evcp/(evcp)/menu-list/page.tsx | 70 |
2 files changed, 123 insertions, 0 deletions
diff --git a/app/[lng]/evcp/(evcp)/menu-access/page.tsx b/app/[lng]/evcp/(evcp)/menu-access/page.tsx new file mode 100644 index 00000000..5c87f754 --- /dev/null +++ b/app/[lng]/evcp/(evcp)/menu-access/page.tsx @@ -0,0 +1,53 @@ +import * as React from "react"; +import { type SearchParams } from "@/types/table"; +import { getValidFilters } from "@/lib/data-table"; +import { Shell } from "@/components/shell"; +import { Skeleton } from "@/components/ui/skeleton"; +import { DataTableSkeleton } from "@/components/data-table/data-table-skeleton"; +import { searchParamsUsersCache } from "@/lib/admin-users/validations" +import { getUsersNotPartners } from "@/lib/users/service"; +import { UserAccessControlTable } from "@/lib/users/access-control/users-table"; + +interface IndexPageProps { + searchParams: Promise<SearchParams>; +} + +export default async function IndexPage(props: IndexPageProps) { + const searchParams = await props.searchParams; + const search = searchParamsUsersCache.parse(searchParams); + const validFilters = getValidFilters(search.filters); + + const promises = Promise.all([ + getUsersNotPartners({ + ...search, + filters: validFilters, + }), + ]); + + return ( + <Shell className="gap-2"> + <div className="flex items-center justify-between space-y-2"> + <div> + <h2 className="text-2xl font-bold tracking-tight">메뉴 접근제어 관리</h2> + <p className="text-muted-foreground"> + 화면, 메뉴별로 접근 통제를 할 수 있습니다. 도메인을 설정하면 해당 도메인에 대한 접근만 가능합니다. + </p> + </div> + </div> + <React.Suspense fallback={<Skeleton className="h-7 w-52" />}></React.Suspense> + <React.Suspense + fallback={ + <DataTableSkeleton + columnCount={4} + searchableColumnCount={1} + filterableColumnCount={2} + cellWidths={["10rem", "40rem", "12rem", "8rem"]} + shrinkZero + /> + } + > + <UserAccessControlTable promises={promises} /> + </React.Suspense> + </Shell> + ); +}
\ No newline at end of file diff --git a/app/[lng]/evcp/(evcp)/menu-list/page.tsx b/app/[lng]/evcp/(evcp)/menu-list/page.tsx new file mode 100644 index 00000000..84138320 --- /dev/null +++ b/app/[lng]/evcp/(evcp)/menu-list/page.tsx @@ -0,0 +1,70 @@ +// app/evcp/menu-list/page.tsx + +import { Suspense } from "react"; +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; +import { Button } from "@/components/ui/button"; +import { RefreshCw, Settings } from "lucide-react"; +import { getActiveUsers, getMenuAssignments } from "@/lib/menu-list/servcie"; +import { InitializeButton } from "@/lib/menu-list/table/initialize-button"; +import { MenuListTable } from "@/lib/menu-list/table/menu-list-table"; +import { Shell } from "@/components/shell" +import * as React from "react" + +export default async function MenuListPage() { + // 초기 데이터 로드 + const [menusResult, usersResult] = await Promise.all([ + getMenuAssignments(), + getActiveUsers() + ]); + + return ( + <Shell className="gap-2"> + <div className="flex items-center justify-between space-y-2"> + <div className="flex items-center justify-between space-y-2"> + <div> + <h2 className="text-2xl font-bold tracking-tight"> + 메뉴 관리 + </h2> + <p className="text-muted-foreground"> + 각 메뉴별로 담당자를 지정하고 관리할 수 있습니다. + </p> + </div> + </div> + + </div> + + + <React.Suspense + fallback={ + "" + } + > + <Card> + <CardHeader> + <CardTitle className="flex items-center gap-2"> + <Settings className="h-5 w-5" /> + 메뉴 리스트 + </CardTitle> + <CardDescription> + 시스템의 모든 메뉴와 담당자 정보를 확인할 수 있습니다. + {menusResult.data?.length > 0 && ( + <span className="ml-2 text-sm"> + 총 {menusResult.data.length}개의 메뉴 + </span> + )} + </CardDescription> + </CardHeader> + <CardContent> + <Suspense fallback={<div className="text-center py-8">로딩 중...</div>}> + <MenuListTable + initialMenus={menusResult.data || []} + initialUsers={usersResult.data || []} + /> + </Suspense> + </CardContent> + </Card> + </React.Suspense> + </Shell> + + ); +}
\ No newline at end of file |
